package com.dao;

import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.Session;

public class DAOIpml implements DAO {

	@Override
	public List<Address> listSearchAddressDAO(String postCode,String street, String town) {
		Session session = Hibernateutill.getSessionFactory().getCurrentSession();
		session.beginTransaction();
		List<Address> addresses = null;
		
			 addresses = (List<Address>)session.createQuery("from Address where postcode LIKE '%" + postCode +"%' AND street LIKE '%"+ street+ "%' AND town LIKE '%" + town + "%'").list();
			
			
		session.getTransaction().commit();
		return addresses;
	}

}
